package com.shasselclub.project.ask.zhuliRecord.service.impl;

import java.util.List;
import java.util.Map;

import com.shasselclub.api.v1.result.WeiXinZhuLiInfo;
import com.shasselclub.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.shasselclub.project.ask.zhuliRecord.mapper.ZhuliRecordMapper;
import com.shasselclub.project.ask.zhuliRecord.domain.ZhuliRecord;
import com.shasselclub.project.ask.zhuliRecord.service.IZhuliRecordService;
import com.shasselclub.common.utils.text.Convert;

/**
 * 好友助力记录Service业务层处理
 * 
 * @author zhengyunfei
 * @date 2022-08-08
 */
@Service
public class ZhuliRecordServiceImpl implements IZhuliRecordService 
{
    @Autowired
    private ZhuliRecordMapper zhuliRecordMapper;

    /**
     * 查询好友助力记录
     * 
     * @param id 好友助力记录主键
     * @return 好友助力记录
     */
    @Override
    public ZhuliRecord selectZhuliRecordById(Long id)
    {
        return zhuliRecordMapper.selectZhuliRecordById(id);
    }

    /**
     * 查询好友助力记录列表
     * @return 好友助力记录
     */
    @Override
    public List<ZhuliRecord> selectZhuliRecordList(Map<String,Object> map)
    {
        return zhuliRecordMapper.selectZhuliRecordList(map);
    }

    /**
     * 新增好友助力记录
     * 
     * @param zhuliRecord 好友助力记录
     * @return 结果
     */
    @Override
    public int insertZhuliRecord(ZhuliRecord zhuliRecord)
    {
        zhuliRecord.setCreateTime(DateUtils.getNowDate());
        return zhuliRecordMapper.insertZhuliRecord(zhuliRecord);
    }

    /**
     * 修改好友助力记录
     * 
     * @param zhuliRecord 好友助力记录
     * @return 结果
     */
    @Override
    public int updateZhuliRecord(ZhuliRecord zhuliRecord)
    {
        return zhuliRecordMapper.updateZhuliRecord(zhuliRecord);
    }

    /**
     * 批量删除好友助力记录
     * 
     * @param ids 需要删除的好友助力记录主键
     * @return 结果
     */
    @Override
    public int deleteZhuliRecordByIds(String ids)
    {
        return zhuliRecordMapper.deleteZhuliRecordByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除好友助力记录信息
     * 
     * @param id 好友助力记录主键
     * @return 结果
     */
    @Override
    public int deleteZhuliRecordById(Long id)
    {
        return zhuliRecordMapper.deleteZhuliRecordById(id);
    }

    @Override
    public int count(Map<String, Object> hdQueryMap) {
        return zhuliRecordMapper.count(hdQueryMap);
    }

    @Override
    public List<WeiXinZhuLiInfo> getZhuLiHeadImg(Map<String, Object> hdQueryMap) {
        return zhuliRecordMapper.getZhuLiHeadImg(hdQueryMap);
    }
}
